| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

TestUtils.h
1 // TestUtils.h
3 //
5
6 namespace nkDebug
7 {
11 class TestUtils final
12 {
13 public :
14
15 // Testing utilities
22 static void check (bool condition, nkMemory::StringView message = "") ;
23
24 public :
25
26 // Template utilities
34 template <typename T>
35 static void areEqual (const T& a, const T& b, nkMemory::StringView message = "") ;
36
45 template <typename T>
46 static
47 std::enable_if_t<!std::is_pointer_v<T>, void>
48 areEqual (T a, T b, T precision, nkMemory::StringView message = "") ;
49
57 template <typename T>
58 static void areNotEqual (const T& a, const T& b, nkMemory::StringView message = "") ;
59
68 template <typename T>
69 static
70 std::enable_if_t<!std::is_pointer_v<T>, void>
71 areNotEqual (T a, T b, T precision, nkMemory::StringView message = "") ;
72
79 template <typename T>
80 static void isNull (T* p, nkMemory::StringView message = "") ;
81
88 template <typename T>
89 static void isNotNull (T* p, nkMemory::StringView message = "") ;
90
91 public :
92
93 // Specialized templates
101 template <typename T = char*>
102 static void areEqual (char* a, char* b, nkMemory::StringView message = "") ;
110 template <typename T = const char*>
111 static void areEqual (const char* const& a, const char* const& b, nkMemory::StringView message = "") ;
119 template <typename T = char*>
120 static void areNotEqual (char* a, char* b, nkMemory::StringView message = "") ;
121
129 template <typename T = const char*>
130 static void areNotEqual (const char* const& a, const char* const& b, nkMemory::StringView message = "") ;
131
132 public :
133
134 // Erased specializations
138 template <typename T = const char*>
139 static void areEqual (const char* a, const char* b, const char* precision, nkMemory::StringView message) = delete ;
140 } ;
141 }
nkDebug::TestUtils::areNotEqual
static void areNotEqual(char *a, char *b, nkMemory::StringView message="")
nkDebug::TestUtils::isNotNull
static void isNotNull(T *p, nkMemory::StringView message="")
nkDebug::TestUtils::areEqual
static void areEqual(const char *a, const char *b, const char *precision, nkMemory::StringView message)=delete
nkDebug::TestUtils::areNotEqual
static std::enable_if_t<!std::is_pointer_v< T >, void > areNotEqual(T a, T b, T precision, nkMemory::StringView message="")
nkDebug::TestUtils::areEqual
static std::enable_if_t<!std::is_pointer_v< T >, void > areEqual(T a, T b, T precision, nkMemory::StringView message="")
nkDebug::TestUtils::areNotEqual
static void areNotEqual(const char *const &a, const char *const &b, nkMemory::StringView message="")
nkDebug::TestUtils::areEqual
static void areEqual(const char *const &a, const char *const &b, nkMemory::StringView message="")
nkDebug::TestUtils
Utilities to write tests.
Definition: TestUtils.h:12
nkDebug::TestUtils::areNotEqual
static void areNotEqual(const T &a, const T &b, nkMemory::StringView message="")
nkDebug::TestUtils::check
static void check(bool condition, nkMemory::StringView message="")
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkDebug::TestUtils::isNull
static void isNull(T *p, nkMemory::StringView message="")
nkDebug::TestUtils::areEqual
static void areEqual(char *a, char *b, nkMemory::StringView message="")
nkDebug
Encompasses all API of component NilkinsDebug.
Definition: LogManager.h:7
nkDebug::TestUtils::areEqual
static void areEqual(const T &a, const T &b, nkMemory::StringView message="")